package com.sgb.kjwl.model.api;

import com.sgb.kjwl.model.entity.AddShoppingCar;
import com.sgb.link.entity.AreaEntity;
import com.sgb.kjwl.model.entity.BannerEntity;
import com.sgb.kjwl.model.entity.BuildEntity;
import com.sgb.kjwl.model.entity.CompanyBuyEntity;
import com.sgb.kjwl.model.entity.CompanyBuyHeader;
import com.sgb.kjwl.model.entity.DeleteShoppingCar;
import com.sgb.kjwl.model.entity.DeviceAttrEntity;
import com.sgb.kjwl.model.entity.DeviceDetailEntity;
import com.sgb.kjwl.model.entity.DeviceEntity;
import com.sgb.kjwl.model.entity.DeviceOutEntity;
import com.sgb.jicai.entity.FilterEntity;
import com.sgb.kjwl.model.entity.InformationEntity;
import com.sgb.kjwl.model.entity.LeaseEntity;
import com.sgb.kjwl.model.entity.MachineDetailEntity;
import com.sgb.kjwl.model.entity.MachineInEntity;
import com.sgb.kjwl.model.entity.MachineOutEntity;
import com.sgb.kjwl.model.entity.MachineRentInEntity;
import com.sgb.link.entity.PublicTypeEntity;
import com.sgb.kjwl.model.entity.MaterialCompanyEntity;
import com.sgb.kjwl.model.entity.MaterialDetailEntity;
import com.sgb.kjwl.model.entity.MaterialListEntity;
import com.sgb.kjwl.model.entity.MaterialMenuEntity;
import com.swgk.core.view.entity.MenuEntity;
import com.sgb.kjwl.model.entity.NewsEntity;
import com.sgb.kjwl.model.entity.PackersBusinessScopeEntity;
import com.sgb.kjwl.model.entity.PackersEntity;
import com.sgb.kjwl.model.entity.PackersPersonDetailEntity;
import com.sgb.kjwl.model.entity.PackersPersonEntity;
import com.sgb.kjwl.model.entity.PackersSkillsEntity;
import com.sgb.kjwl.model.entity.PackersTeamEntity;
import com.sgb.kjwl.model.entity.ParentAreaEntity;
import com.sgb.kjwl.model.entity.PickDeviceEntity;
import com.sgb.kjwl.model.entity.PickProInfoEntity;
import com.sgb.kjwl.model.entity.PickTypeEntity;
import com.sgb.kjwl.model.entity.ProChildListEntity;
import com.sgb.kjwl.model.entity.ProListEntity;
import com.sgb.kjwl.model.entity.ProvinceEntity;
import com.sgb.kjwl.model.entity.RentingEntity;
import com.sgb.kjwl.model.entity.SearchDeviceOutEntity;
import com.sgb.kjwl.model.entity.SearchMachineInEntity;
import com.sgb.kjwl.model.entity.SearchMachineOutEntity;
import com.sgb.kjwl.model.entity.SearchMaterialEntity;
import com.sgb.kjwl.model.entity.ShoppingCarEntity;
import com.sgb.kjwl.model.entity.SupplierEntity;
import com.sgb.kjwl.model.entity.TalentEntity;
import com.sgb.kjwl.model.entity.TenderInfoEntity;
import com.sgb.kjwl.model.entity.user.NewCategeryEntity;
import com.sgb.kjwl.model.response.CommonResponse;
import com.swgk.core.base.model.entity.ListResponse;
import com.swgk.core.base.model.entity.BaseEntity;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;

/**
 * Description:
 * Author zhengkewen
 * Time 2019/4/2
 */
public interface RetrofitInterface {
    //工程材料
    //获取工程材料banner
    @GET("api/cms/getBannerListFromWap")
    Observable<BaseEntity<List<BannerEntity>>> getMaterialBanner();

    //获取菜单选项
    @GET("api/itemCat/getList")
    Observable<BaseEntity<List<MenuEntity>>> getMenu();

    //获取材料菜单选项
    @GET("api/recommend/getAll")
    Observable<BaseEntity<List<MaterialMenuEntity>>> getMaterialMenu();

    //获取材料对应菜单列表
    @POST("api/search/findItem?page=1&size=8&sort=0")
    Observable<ListResponse<List<MaterialListEntity>>> getMaterialList(@Body Map map);

    //获取优质供货商
    @GET("api/supply/recommend/toplist")
    Observable<BaseEntity<List<CommonResponse<SupplierEntity>>>> getSupplierList(@Query("areacode") String areacode);

    //获取平台资讯
    @GET("api/article/list/10")
    Observable<BaseEntity<List<CommonResponse<InformationEntity>>>> getInformation(@Query("areacode") String areacode);

    //获取资讯详情
    @GET("api/article/detail/{id}")
    Observable<BaseEntity<NewsEntity>> getNewsDetail(@Path("id") String id);

    //获取工程材料热门搜索
    @GET("api/search/getHotKey")
    Observable<List<String>> getMaterialHotSearch();

    //获取工程材料检索
    @GET("api/search/searchItem")
    Observable<ListResponse<List<SearchMaterialEntity>>> getMaterialSearch(@Query("areacode") String areacode, @Query("item_provinceId") String item_provinceId, @Query("key") String key, @Query("page") int page, @Query("size") int size);

    //获取工程材料筛选列表(Map包含筛选条件和Sort排序参数)
    @POST("api/search/findItem")
    Observable<ListResponse<List<SearchMaterialEntity>>> getMaterialFilterList(@Query("page") int page, @Query("size") int size, @Query("sort") int sort, @Body Map map);

    //获取工程材料产品详情信息
    @GET("api/item/getItem/{Pid}")
    Observable<BaseEntity<MaterialDetailEntity>> getMaterialDetail(@Path("Pid") String pid, @Query("areacode") String areacode);

    //获取工程工队详情信息
    @GET("teamTemp/{id}")
    Observable<BaseEntity<PackersEntity>> getPackersEntity(@Path("id") String id);

    //获取购物车详情
    @GET("api/cart/getCartList")
    Observable<BaseEntity<List<ShoppingCarEntity>>> getShoppingCarEntity(@Query("areacode") String areacode);

    //加入购物车
    @POST("api/cart/addCart")
    Observable<BaseEntity> addShoppingCar(@Body AddShoppingCar addShoppingCar);

    //获取购物车数量
    @GET("api/cart/getCartCount")
    Observable<BaseEntity<String>> getCarCount(@Query("areacode") String areacode);

    //更新购物车
    @PUT("api/cart/updateCart")
    Observable<BaseEntity<Boolean>> updateShoppingCar(@Body Map map);

    //删除购物车
    @POST("api/cart/deleteByids")
    Observable<BaseEntity> deleteShoppingCar(@Body DeleteShoppingCar deleteShoppingCar);

    //获取工程人才技能与证书详情信息
    @GET("talent/type/{id}")
    Observable<BaseEntity<PackersSkillsEntity>> getPackersSkillsEntity(@Path("id") String id);

    //获取工程工队业务范围信息
    @GET("teamTemp/type/{id}")
    Observable<BaseEntity<PackersBusinessScopeEntity>> getPackersBusinessScopeEntity(@Path("id") String id);

    //获取工程人才详情信息
    @GET("api/talent/home/{id}")
    Observable<BaseEntity<PackersPersonDetailEntity>> getPackersPersonDetailEntity(@Path("id") String id);

    //获取工程材料产品详情信息中的相关公司信息
    @GET("companyInfo/getGoodsCompanyInfoDetailsFront/{Cid}")
    Observable<BaseEntity<MaterialCompanyEntity>> getMaterialCompany(@Path("Cid") String cid, @Query("areacode") String areacode);

    //工程机械
    //获取工程材料banner
    @GET("api/index/bannerList")
    Observable<BaseEntity<List<BannerEntity>>> getMachineBanner();

    //获取工程菜单选项
    @GET("api/index/categoryList")
    Observable<BaseEntity<List<MenuEntity>>> getMachineMenu();

    //获取出租推荐
    @GET("api/index/rentList")
    Observable<BaseEntity<List<LeaseEntity>>> getMachineLease(@Query("areacode") String areacode);

    //获取最新求租
    @GET("api/index/wantList")
    Observable<BaseEntity<List<RentingEntity>>> getMachineRenting(@Query("areacode") String areacode);

    //获取所在地区
    @GET("v1/app/machinery/categoryList")
    Observable<BaseEntity<List<ParentAreaEntity<List<ParentAreaEntity>>>>> getMachineArea(@Query("areacode") int areacode);

    //获取出租列表
    @POST("/search/getRentInfo")
    Observable<BaseEntity<ListResponse<List<MachineOutEntity>>>> getMachineOut(@Query("page") int page, @Query("limit") int limit, @Query("priceSort") int priceSort, @Body Map map);

    //获取机械类型
    @GET("api/index/getCategory")
    Observable<BaseEntity<List<PublicTypeEntity>>> getMachineType();

    //获取出租筛选机械类型
    @GET("api/index/getCategory")
    Observable<BaseEntity<List<FilterEntity<List<FilterEntity>>>>> getMachineFilter();

    //获取出租筛选机械信息
    @GET("search/getRentInfoParam")
    Observable<BaseEntity<List<FilterEntity<List<FilterEntity>>>>> getMachineFilterInfo(@Query("categoryNo") String categoryNo, @Query("typeNo") String typeNo, @Query("areacode") int areacode);

    //获取求租列表
    @POST("search/getWantedInfo")
    Observable<BaseEntity<ListResponse<List<MachineInEntity>>>> getMachineIn(@Query("page") int page, @Query("limit") int limit, @Query("priceSort") int priceSort, @Body Map map);

    //获取求租详情
    @GET("api/wantedMachinery/{id}")
    Observable<BaseEntity<MachineRentInEntity>> getMachineInDetail(@Path("id") String id);

    //获取工程机械热门搜索
    @GET("search/getHotkeys")
    Observable<List<String>> getMachineHotSearch();

    //获取工程机械出租检索
    @POST("search/searchRentInfo")
    Observable<BaseEntity<ListResponse<List<SearchMachineOutEntity>>>> getMachineSearch(@Query("page") int page, @Query("limit") int limit, @Body Map map);

    //获取工程机械求租检索
    @POST("search/searchWantedInfo")
    Observable<BaseEntity<ListResponse<List<SearchMachineInEntity>>>> getMachineInSearch(@Query("page") int page, @Query("limit") int limit, @Body Map map);

    //获取工程机械产品详情信息
    @GET("api/rentInfo/home/{id}")
    Observable<BaseEntity<MachineDetailEntity>> getMachineDetail(@Path("id") String id);

    //工程设备
    //获取工程设备banner
    @GET("api/equipindex/getBanner")
    Observable<BaseEntity<List<BannerEntity>>> getDeviceBanner();

    //获取菜单选项
    @GET("api/equipindex/getCategory")
    Observable<BaseEntity<List<MenuEntity>>> getDeviceMenu();

    //获取推荐设备
    @GET("api/equipindex/getEquipment")
    Observable<BaseEntity<List<DeviceEntity>>> getDeviceRecommand(@Query("areacode") String areacode);

    //获取出租列表
    /*@GET("api/equipment/rentInfo/list")
    Observable<ListResponse<List<DeviceOutEntity>>> getDeviceOut(@Query("page") int page, @Query("limit") int limit, @Query("priceSort") int priceSort, @Query("timeSort") int timeSort);
*/
    //获取出租列表
    @POST("api/equipment/rentInfo/search")
    Observable<ListResponse<List<DeviceOutEntity>>> getDeviceOut(@Body Map map);

    //获取所在地区
    @GET("api/equipment/rentInfo/getaddress")
    Observable<BaseEntity<List<ParentAreaEntity<List<ParentAreaEntity>>>>> getDeviceArea(@Query("areacode") int areacode);

    //获取所有省份、自治区、直辖市
    @GET("index/getCurrentProvince")
    Observable<BaseEntity<List<ProvinceEntity<List<ProvinceEntity>>>>> getAllProvince();

    //获取筛选信息
    @GET("api/equipment/rentInfo/category")
    Observable<BaseEntity<List<FilterEntity<List<FilterEntity>>>>> getDeviceFilter();

    //根据no获取筛选信息
    @GET("api/equipment/rentInfo/getattribute/{pNo}/{cNo}")
    Observable<BaseEntity<List<FilterEntity<List<FilterEntity>>>>> getDeviceFilterByNumber(@Path("pNo") String pNo, @Path("cNo") String cNo);

    //获取工程设备热门搜索
    @GET("api/search/getHotKey")
    Observable<List<String>> getDeviceHotSearch();

    //获取工程设备检索
    @POST("api/search/findItem")
    Observable<ListResponse<List<SearchDeviceOutEntity>>> getDeviceOutSearch(@Query("page") int page, @Query("size") int size, @Query("sort") int sort, @Body Map map);

    //获取工程设备产品详情
    @GET("api/equipment/rentInfo/home/{id}")
    Observable<DeviceDetailEntity> getDeviceDetail(@Path("id") String id);

    //获取工程设备产品参数
    @GET("api/equipment/rentInfo/attribute/{id}")
    Observable<BaseEntity<ListResponse<List<DeviceAttrEntity>>>> getDeviceAttribute(@Path("id") String id);

    //工程工队
    //获取工程工队banner
    // TODO: 2019/7/8 后台接口更改，areacode暂时写死
    @GET("api/index/getBanner/APP?areacode=610000")
    Observable<BaseEntity<List<BannerEntity>>> getPackersBanner();

    //获取工队菜单
//    @GET("api/sysTeamCategory/findCategoryListTree")
    @GET("api/index/getTeamCategory")
    Observable<BaseEntity<List<MenuEntity>>> getPackersMenu();

    //获取推荐施工工队
    @GET("api/index/getRecommendTeam")
    Observable<BaseEntity<List<BuildEntity>>> getPackersBuild(@Query("areacode") String areacode);

    //获取推荐专业人才
    @GET("api/index/getRecommendTalent")
    Observable<BaseEntity<List<TalentEntity>>> getPackersTalent(@Query("areacode") String areacode);

    //获取人才列表
    @POST("search/getTalent")
    Observable<BaseEntity<ListResponse<List<PackersPersonEntity>>>> getPackersPerson(@Query("page") int page, @Query("limit") int limit, @Body Map map);

    //获取工队列表
    @POST("search/getTeam")
    Observable<BaseEntity<ListResponse<List<PackersTeamEntity>>>> getPackersTeam(@Query("page") int page, @Query("limit") int limit, @Body Map map);

    //工程招采
    //获取城市
    @GET("api/font/citys")
    Observable<BaseEntity<ListResponse<List<AreaEntity>>>> getAreaList();

    //获取企业采购
    @POST("api/font/company")
    Observable<BaseEntity<ListResponse<List<CompanyBuyHeader<CompanyBuyEntity>>>>> getCompanyBuy(@Body Map map);

    //获取招标类型
    @GET("api/font/getTypeList")
    Observable<BaseEntity<List<PickTypeEntity>>> getTypeList();

    //获取招采信息公司项目详情
    @GET("api/font/companyProject")
    Observable<BaseEntity<PickProInfoEntity<ProListEntity<List<ProChildListEntity>>>>> companyProject(@Query("compNo") String compNo);

    //火热招标详情  测试地址
    @GET("api/font/getTenderInfo")
    Observable<BaseEntity<TenderInfoEntity>> getHotTenderInfo(@Query("no") String no);

    //招采信息-火热招标
    @GET("api/font/getWapList")
    Observable<BaseEntity<ListResponse<List<PickDeviceEntity>>>> getPickBid(@Query("no") String no, @Query("projectNo") String projectNo, @Query("pageSize") int size, @Query("pageNum") int num);

    //用户中心
    //分类
    //获取分类
    //新地址/v1/app/material/firstCategory  老地址api/itemCat/getList
    @POST("v1/app/material/firstCategory")
    Observable<BaseEntity<List<MenuEntity<MenuEntity<MenuEntity>>>>> getCategoryMenu(@Query("areaCode") String areaCode);

    //用户中心
    //分类
    //获取分类
    //新地址/v1/app/material/secondCategory
    @POST("v1/app/material/secondCategory")
    Observable<BaseEntity<List<MenuEntity<MenuEntity>>>> getsecondCategory(@Query("id") String id, @Query("areaCode") String areaCode);

    //分类
    //获取分类
    @GET("api/itemCat/getList")
    Observable<BaseEntity<List<NewCategeryEntity<List<NewCategeryEntity<List<NewCategeryEntity>>>>>>> getNewCategoryMenu();
}

